#!/bin/bash -ex

git clone --depth=1 https://github.com/lief-project/LIEF lief \
    || cd lief && git pull && cd ..
source ctf-tools-venv-activate
rm -rf build || true
mkdir build
cd build
cmake -DLIEF_PYTHON_API=on -DPYTHON_VERSION=2.7 -DCMAKE_BUILD_TYPE=Release ../lief/
cmake --build . --target LIB_LIEF_STATIC --config Release
cmake --build . --target LIB_LIEF_SHARED --config Release # for the shared one
cmake --build . --target pyLIEF --config Release
pip install api/python/
